/** @type {import('next').NextConfig} */
const withAntdLess = require("next-plugin-antd-less");
const nextConfig = withAntdLess({
  output: "standalone",
  // reactStrictMode: true,
  productionBrowserSourceMaps: true,

  transpilePackages: ["@ant-design/pro-editor"],
  experimental: {
    forceSwcTransforms: true,
    serverActions: true, // 开启server action
  },

  compiler: {
    removeConsole: process.env.NODE_ENV === "production" ? true : false,
    styledComponents: true,
  },

  modifyVars: { "@primary-color": "#f74a49" },
  lessVarsFilePathAppendToEndOfContent: false,
  cssLoaderOptions: {},
  webpack(config) {
    return config;
  },
  future: {
    // if you use webpack5
    webpack5: true,
  },
  webpack: (config) => {
    /* add to the webpack config module.rules array */
    config.module.rules.push({
      /* `test` matches file extensions */
      test: /\.(numbers|xls|xlsx|xlsb)/,
      /* use the loader script */
      use: [{ loader: "./base64-loader" }],
    });
    return config;
  },
});

module.exports = nextConfig;
